package com.zhengsr.wanandroid;

import android.app.Activity;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.View;

import com.zhengsr.wanandroid.activity.WebViewActivity;

/**
 * Created by zhengshaorui
 * Time on 2019/2/25
 */

public class Utils {
    public static  void startAricleActivity(View view, Activity activity,Bundle bundle){
        Context context = view.getContext();
        Intent intent = new Intent(context, WebViewActivity.class);
        if (bundle != null) {
            intent.putExtras(bundle);
        }
        if (Build.VERSION.SDK_INT >= 21) {
            ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(activity, view, "shareView");
            context.startActivity(intent,options.toBundle());
        }else{
            context.startActivity(intent);
        }
    }
}
